package com.csii.modules.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csii.modules.system.entity.SysDataSource;
import com.csii.modules.system.mapper.SysDataSourceMapper;
import com.csii.modules.system.service.ISysDataSourceService;
import org.springframework.stereotype.Service;

/**
 * @Description: 多数据源管理
 * @Author: power-stdio
 * @Date: 2019-12-25
 * @Version: V1.0
 */
@Service
public class SysDataSourceServiceImpl extends ServiceImpl<SysDataSourceMapper, SysDataSource> implements ISysDataSourceService {
    @Override
    public SysDataSource getUseDataSource(){
        return baseMapper.selectOne(new LambdaQueryWrapper<SysDataSource>(SysDataSource.class).eq(SysDataSource::getUsed,1));
    }
}
